package com.foton.lotterydomain.support.ids.policy;

import com.foton.lotterydomain.support.ids.IdGenerator;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.stereotype.Component;

/**
 * @Author RenPu
 * @Date 2023/12/2 16:41
 * @Version 1.0
 * @Description: 随机算法，用于生成策略ID
 **/

@Component
public class RandomNumeric implements IdGenerator {

    @Override
    public long nextId() {
        //通过apache工具包下的工具类，来实现ID号的生成
        return Long.parseLong(RandomStringUtils.randomNumeric(11));
    }
}
